home *** CD-ROM | disk | FTP | other *** search
- /* Example of EasyRequest with IDCMP flags */
-
- x = addlib("apig.library",0,-30,0)
-
- call set_apig_globals()
-
- portname = "easyreq3_port"
- p = openport(portname)
-
- WaitForPort portname
-
- wintitle = "Easy Requester Example"
- winidcmp = CLOSEWINDOW
- winflags = WINDOWCLOSE+WINDOWDRAG+WINDOWSIZING+WINDOWDEPTH+GIMMEZEROZERO
-
- win = openwindow(portname,0,0,640,200,2,4,winidcmp,winflags,wintitle,null(),0,0,0)
-
- reqtitle = "This is your EasyRequester"
-
- reqtext = "Say Buddy If You Insert or Remove a Disk ..." '0a'x '0a'x
- reqtext = reqtext || " ... I'll go away"
-
- reqgads = " OKAY | MAYBE | NOWAY "
-
- reqx = EASYREQUEST(win,reqtitle,reqtext,reqgads,null(),DISKINSERTED+DISKREMOVED,0)
-
- call CLOSEWINDOW(win)
-
- select
- /* **** NOTE **** */
- /* if requester was satisfied by IDCMP, the return value is negative */
-
- when (-1 * reqx) = DISKINSERTED then say "I see you Inserted a DISK"
- when (-1 * reqx) = DISKREMOVED then say "I see you Removed a DISK"
- when reqx = 1 then say " 'OKAY' ... is OKAY with me too !"
- when reqx = 2 then say " 'MAYBE' ... not sure uh ? "
- when reqx = 0 then say " 'NOWAY' ... I'm outta here !"
- otherwise nop
-
- end
-
- exit
-